import Vue from 'vue'
import VueRouter from 'vue-router'

// 导入layout
// import layout from '../layout/index.vue'

Vue.use(VueRouter)

const routes = [

  // 登录
  {
    path: '/login',
    name: 'login',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/login.vue')
  },

  // Layout布局
  {
    path: '/',
    name: 'Layout',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ '../layout/index.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
